From: Joey Hess Date: Tue, 11 Mar 2025 15:49:47 +0000 (-0400) Subject: avoid error on missing compute state in checkKey X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~6^2~90 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=5760a15c7c78d3cc5fffa369f1f8eb5aa8e057c5;p=git-annex.git avoid error on missing compute state in checkKey This improves eg `git-annex move --to` a compute remote that does not contain the key. Rather than erroring with "Missing compute state" when it checks if the key is in the remote, it proceeds to trying to store to it, which has a nice error message. --- diff --git a/Remote/Compute.hs b/Remote/Compute.hs index 3adec4bc5b..7ed6040ceb 100644 --- a/Remote/Compute.hs +++ b/Remote/Compute.hs @@ -756,9 +756,7 @@ avoidCycles outputkeys inputkey = filterM go checkKey :: RemoteStateHandle -> Key -> Annex Bool checkKey rs k = do states <- getComputeStatesUnsorted rs k - if null states - then giveup "Missing compute state" - else return True + return (not (null states)) -- Unsetting the compute state will prevent computing the key. dropKey :: RemoteStateHandle -> Maybe SafeDropProof -> Key -> Annex ()